const redLight = () => new Promise(resolve => {
    console.log('红灯亮...');
    setTimeout(() => resolve(), 5000);
});
const greenLight = () => new Promise(resolve => {
    console.log('绿灯亮...');
    setTimeout(() => resolve(), 5000);
});
const yellowLight = () => new Promise(resolve => {
    console.log('黄灯亮...');
    setTimeout(() => resolve(), 1000);
});

const exec = () => {
    redLight().then(() => greenLight()).then(() => yellowLight()).then(() => exec());
}

exec();